package ru.aslanov.schedule.model;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

/**
 * Created by IntelliJ IDEA.
 * Created: Feb 19, 2010 12:03:17 PM
 *
 * @author Sergey Aslanov
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class User extends Entity {
    @Persistent
    private String email;    
    @Persistent
    private boolean isAdmin;

    @Persistent
    private Schedule schedule;

    public String getEmail() {
        return email;
    }

    public boolean isAdmin() {
        return isAdmin;
    }

    public void setEmail(String email) {
        this.email = email != null ? email.toLowerCase() : null;
    }

    public void setIsAdmin(boolean admin) {
        isAdmin = admin;
    }

    public Schedule getSchedule() {
        return schedule;
    }
}
